From d7f4473faec4c27b759e29d01813395ddfe4ed60 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Wed, 22 Feb 2006 21:52:30 +0100 Subject: [PATCH] Adding a second IP address onto eth0 causes the vif-* hotplug scripts to fail: ip_of() is returning a LIST of IP addresses, one per line. The vif-scripts attempt to use the list where single addresses ought to be, with predictable results. This patch changes ip_of() to return the first address in the list, which seems to be the first one configured. Signed-off-by: Jim Dykman --- tools/examples/vif-common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/examples/vif-common.sh b/tools/examples/vif-common.sh index 3cbaa591b1..6ce280c4f2 100644 --- a/tools/examples/vif-common.sh +++ b/tools/examples/vif-common.sh @@ -125,7 +125,7 @@ function handle_iptable() # function ip_of() { - ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed 's,/.*,,' + ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed 's,/.*,,' | head -1 } -- 2.30.2